import request from '@/utils/request'

var myurl = '/Doctor/visits';

// 根据流水号获得患者信息
export function updatePost(data) {
  return request({
    url: '/doctor/register/add',
    method: 'get',
    params: data
  })
}

//就诊完成
export function succeed(patientId) {
  return request({
    url: myurl+'/succeed',
    method: 'get',
    params: {patientId:patientId}
  })
}


//添加病例
export function addCase(data,historyPatientId) {
  return request({
    url: myurl+'/add/'+historyPatientId,
    method: 'post',
    params: data,
  })
}


//添加检查项
export function addCheck(list,patientId) {
  return request({
    url: myurl+'/addCheck/'+patientId+'/'+list,
    method: 'post',
  })
}

//添加药用
export function addDrug(drug,num,patientId) {
  return request({
    url: myurl+'/addDrug/'+patientId+'/'+drug+'/'+num,
    method: 'post',
  })

}


// 查询患者挂号类型信息
export function getPatients() {
  return request({
    url: myurl+'/list',
    method: 'get',
  })
}

//用户信息回显
export function findPatient(patientId) {
  return request({
    url: myurl+'/findPatient',
    method: 'get',
    params: {patientId}
  })
}

//获得历史病例
export function gethistory(query) {
  return request({
    url: '/doctor/registerpatient/zzhistory',
    method: 'get',
    params: query
  })
}

export function getDrug() {
  return request({
    url: '/pssd/drug/list',
    method: 'get',
  })
}

export function queryCheckName() {
  return request({
    url:'/docter/examine/queryCheckName',
    method: 'get',
  })
}
